package com.zfei.gfb.request;

import cn.hutool.core.lang.Validator;
import com.zfei.gfb.util.ObjUtil;
import com.zfei.gfb.bean.Status;
import com.zfei.gfb.bean.StatusException;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;


/**
 * @author fgh
 */
@ApiModel("房屋预约接口入参")
public class GfbHouseApplyRequest {

    @ApiModelProperty(value = "房源id", required = true)
    private Integer houseId;

    @ApiModelProperty(value = "申请人", required = true)
    private String userName;
    @ApiModelProperty(value = "联系电话", required = true)
    private String phone;
    @ApiModelProperty(value = "提交日期")
    private Long applyDate;
    @ApiModelProperty(value = "备注")
    private String remark;

    public Integer getHouseId() {
        return houseId;
    }

    public void setHouseId(Integer houseId) {
        this.houseId = houseId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Long getApplyDate() {
        return applyDate;
    }

    public void setApplyDate(Long applyDate) {
        this.applyDate = applyDate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void checkInsertNull() {
        if (ObjUtil.anyNull(houseId, userName, phone, applyDate)) {
            throw new StatusException(Status.INVALID_ARGUMENT);
        }
//        if(!Validator.isMobile(phone)){
//            throw new StatusException(Status.INVALID_ARGUMENT);
//        }
    }

}

